package cn.liutao.order.entity.vo;

import cn.liutao.dish.entity.po.Dish;
import cn.liutao.dish.entity.po.Taste;
import cn.liutao.order.entity.po.Cart;
import com.mybatisflex.annotation.RelationManyToOne;
import lombok.Data;

import java.math.BigDecimal;

/**
 * @author liutao
 * @Description 购物车vo类
 * @date 2023/11/1 16:53
 * @Version 1.0
 */
@Data
public class CartVo extends Cart {

    @RelationManyToOne(
            selfField = "tasteId",
            targetField = "id",
            targetTable = "taste",
            extraCondition = "status = :tasteStatus"
    )
    private Taste taste;

    @RelationManyToOne(
            selfField = "dishId",
            targetField = "id",
            targetTable = "dish",
            extraCondition = "status = :dishStatus"
    )
    private Dish dish;

    private BigDecimal unitPrice;
}
